package com.study.thread.demo.future;

import java.util.concurrent.Callable;
import java.util.concurrent.TimeUnit;

public class FutureDemo implements Callable<String> {

    private String param;

    public FutureDemo(String param) {
        this.param = param;
    }

    @Override
    public String call() throws Exception {
        //模拟执行业务逻辑的耗时
        TimeUnit.SECONDS.sleep(5);
        String result = this.param + " 处理完成！";
        return result;
    }
}
